<?php

/**
 * Description of OS_login
 *
 * @author GodSon
 */
class OS_login extends CI_Model{
    function __construct() {
        parent::__construct();
    }
    
    var $username ="";
    var $password ="";
    
    function login(){
        $this->load->helper('security');
        
        $this->username = $this->input->post('username');
        $this->password = do_hash( $this->input->post('password'),'md5');
        $sql = "select * from gd_user where name= ? and password = ?";
        $query = $this->db->query($sql,array($this->username,  $this->password));
       // echo json_encode($query->result());
        return $query->num_rows();
    }
}

?>
